import Vue from "vue";
// import Vuex from "vuex";
import Vuex from "@/vuex_self/index.js";

Vue.use(Vuex);

export default new Vuex.Store({
    state: {
        age: 10
    },
    getters: {
        ageDouble (state) {
            console.log('1111');
            return state.age * 2;
        }
    },
    mutations: {
        changeAge (state, data) {
            state.age += data;
        }
    },
    actions: {
        testAge ({commit}, data) {
            setTimeout(() => {
                commit('changeAge', data);
            }, 1000);
        }
    },
    modules: {},
});
